package online.heycm.platform.web.cloud;

import online.heycm.platform.web.cloud.interceptor.FeignInterceptor;
import online.heycm.platform.web.common.filter.MethodFilter;
import online.heycm.platform.web.common.filter.TraceFilter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author heycm
 * @since 2023/12/9 18:08
 */
@Configuration
public class WebCloudAutoConfiguration {
    @Bean
    @ConditionalOnMissingBean
    public MethodFilter methodFilter() {
        return new MethodFilter(0);
    }

    @Bean
    @ConditionalOnMissingBean
    public TraceFilter traceFilter() {
        return new TraceFilter(1);
    }

    @Bean
    public FeignInterceptor feignInterceptor() {
        return new FeignInterceptor();
    }
}
